package ru.spb.osll.myfit.common;

import com.google.gwt.user.client.rpc.IsSerializable;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamOmitField;

import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;

@XStreamAlias("suite")
public class Suite implements IsSerializable {
  @XStreamAlias("root")
  private String m_root;

  @XStreamOmitField
  private String m_id;

  @XStreamAlias("tags")
  private Set<PageTag> m_tags = new TreeSet<PageTag>();

  public Suite() {
  }

  public Suite(String id) {
    m_id = id;
  }

  public String getRoot() {
    return m_root;
  }

  public void setRoot(String root) {
    this.m_root = root;
  }

  public String getId() {
    return m_id;
  }

  public void setId(String m_id) {
    this.m_id = m_id;
  }

  public Set<PageTag> getTags() {
    return Collections.unmodifiableSet(m_tags);
  }

  public void addTag(PageTag tag) {
    m_tags.add(tag);
  }

  public void setTags(Set<PageTag> tags) {
    m_tags.clear();
    m_tags.addAll(tags);
  }
}
